package com.ha7419x.service;

import com.commons.config.FeignClientConfig;
import com.ha7419x.service.fallback.IDeptClientServiceFallbackFactory;
import com.ha7419x.vo.Dept;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@FeignClient(value = "DEMO-ZUUL-GATEWAY", configuration = FeignClientConfig.class
        , fallbackFactory = IDeptClientServiceFallbackFactory.class)
public interface IDeptClientService {

    @RequestMapping(method = RequestMethod.GET, value = "/demo/dept-proxy/dept/get/{id}")
    Dept get(@PathVariable("id") Long id);

    @RequestMapping(method = RequestMethod.GET, value = "/demo/dept-proxy/dept/list")
    List<Dept> list();

    @RequestMapping(method = RequestMethod.POST, value = "/demo/dept-proxy/dept/add")
    boolean add(@RequestBody Dept dept);
}
